package cn.tedu.tea.domain.service;

import cn.tedu.tea.domain.bo.ContentBO;
import cn.tedu.tea.domain.repository.ContentRepository;
import cn.tedu.tea.protocol.param.ContentParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class ContentService {

    @Autowired
    private ContentRepository contentRepository;


    public int insert(ContentParam contentParam) {

        return contentRepository.insert(contentParam);
    }


    public int deleteById(int id) {
        return contentRepository.delete(id);
    }

    public ContentBO selectById(Integer id) {
        return contentRepository.selectById(id);
    }


    public List<ContentBO> selectAll() {

        return contentRepository.selectAll();
    }


    public int modifyContent(ContentParam contentParam) {
        return contentRepository.updateByPrimaryKey(contentParam);
    }
}
